<?php
class Billing {
    protected $objStorage;
    function __construct(&$objStorage) {
        $this->objStorage   =   $objStorage;
    }

    public function calculate() {
        foreach ($this->objStorage->getItemList() as $subList) {
                foreach ($subList as &$item) {
                      // Set patientPrice = originalPrice - insurancePrice - discount
                    $patientPrice  = $item->getOriginalPrice()- $item->getInsurancePrice()- $item->getDiscount();
                    if ($patientPrice < 0) {
                    	$patientPrice  =   0;
                    }
                    $item->setPatientPrice($patientPrice);
                }
            }
    }
}
?>